import { computed, makeAutoObservable } from 'mobx';

class StuStore {
  constructor() {
    makeAutoObservable(this, {
      printStu: computed,
    });
  }

  stu = {
    name: 'jetwang',
    age: 24,
  };

  setStu = () => {
    this.stu.name = 'jackson';
  };

  get printStu() {
    return `My name is ${this.stu.name}, and my age is ${this.stu.age}`;
  }
}

const stuStore = new StuStore();

export default stuStore;
